const TokenKey = "token";
export function isLogin() {
  const userInfo = sessionStorage.getItem("userInfo");
  if (userInfo) {
    return JSON.parse(userInfo).token;
  }
}

export function setLogin(val: string): void {
  sessionStorage.setItem(TokenKey, val);
}

export function logout(): void {
  sessionStorage.removeItem(TokenKey);
}
